﻿using SYJ.Factory;
using SYJ.IDAL;
using SYJ.Model.Entities;
using SYJ.Model.ViewModel.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;

namespace SYJ.MySqlDAL
{
    public class SysUserDAL : BaseDal<SysUser>, ISysUserDAL 
    {
        public SysUser Login(LoginModel model)
        {
            using (var db= DBConnectionFactory.CreateConnection())
            {
                return db.QuerySingleOrDefault<SysUser>("select * from sys_user limit 1 ", new { user_name = model.username, password = model.password });
                //return Conn.QuerySingle<SysUser>("", new { user_name = "", password = "" })!=null;
            }
           // List<SysUser> user = new List<SysUser>();
            
        }
    }
}
